<?php

/**
 * 微博抓取管理
 */

include_once($_SERVER["DOCUMENT_ROOT"] . "/core/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/core/admin.inc.php");

include_once($_SERVER["DOCUMENT_ROOT"] . "/include/user/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/include/mblog/inc.php");
include_once($_SERVER["DOCUMENT_ROOT"] . "/include/gonglue/inc.php");
$g_cgival = array();
$g_pro = array();
$g_show = array();


function check_cgi_pro()
{
	global $g_cgival, $g_pro, $g_show;
		//页码
	cgi::get($g_cgival["id"], "id", 0);
	
	
	
}

function get_data()
{
	global $g_cgival, $g_pro, $g_show,$config;
	
	$g_show["id"]= $id = $g_cgival["id"];
	
	$db_mblog_cron_topic_tag = new db_mblog_cron_topic_tag();
	$topic_list = $db_mblog_cron_topic_tag->admin_get_mblog_cron_topic_tag_list_by_search(1,10000,"",1);
	foreach($topic_list as $key => $value)
	{
		if($value["show_type"] != 1 && $value["show_type"] != 2)
		{
			unset($topic_list[$key]);
		}
	}
	$topic_list = array_values($topic_list);
	$g_show["topic_list"] = $topic_list;
	
	
	$g_show["gonglue_type"] = $config["gonglue_type"];
	
	$db_gonglue_cron_topic = new db_gonglue_cron_topic();
	$data = $db_gonglue_cron_topic->admin_get_one_by_id($id);
	$g_show["data"]  = $data;
	
	
	$g_show["site_name"] = $config["site_name"];
	
	$g_show["gonglue_content_type"] = $config["gonglue_content_type"];
}

$g_show["error"] = 0;
$g_show["errmsg"] = '';
try
{
	admin_check_login();
// 	admin_check_user_priv("foodv2/album_list.php");
	
	check_cgi_pro();
	get_data();
}
catch(Exception $e)
{
	$g_show["error"] = 1;
	$g_show["errmsg"] = $e->getMessage();
}

show_pro();
exit;


function show_pro()
{
	global $g_cgival, $g_pro, $g_show;
	if(isset($_GET['debug']))
		print_r($g_show);
	$smarty = p_get_smarty ();
	$smarty->assign ( 'g_show', $g_show );
	$smarty->display ( "gonglue/gonglue_cron_topic_edit.html" );
}

